<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./CFly.min.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
            position: relative;
        }
        
        .add {
            border-style: none;
            width: 120px;
            height: 30px;
            background: #008cff;
            color: white;
            margin: 20px;
            font-size: 14px;
            cursor: pointer;       
        }

        .car-container {
            display: flex;
            justify-content: flex-end;
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 40px;
            box-shadow: 0 0 5px rgba(0,0,0,.1)
        }

        .car-container .car {
            line-height: 40px;
            height: 40px;
            width: 80px;
            background: #008cff;
            color: white;
            text-align: center;
        }
    </style>
</head>
<body>
    <button CFly-goods-img="demo.png" class="add">添加到购物车</button>
    <div class="car-container">
        <div class="car">购物车</div>
    </div>
    <script>
        var cFly = new CFly({
            clickDom: '.add',
            targetDom: '.car',
            frameRate: 5
        })
    </script>
</body>
</html>